#include <iostream>
#include <iomanip>
#include <deque>
using namespace std;

typedef unsigned int uint;
typedef deque <uint> Deque;
typedef Deque::iterator It;
typedef Deque::reverse_iterator Rit;

const uint MOD = 10000;
const uint FILLW = 4;

ostream & operator << (ostream &os, Deque d)
{
	It it = d.begin();
	os << *it;
	for (++it; it != d.end(); ++it){
		os << setfill ('0') << setw (FILLW) << *it;
	}
	return os;
}

void operator *= (Deque &d, uint factor)
{
	Rit it;
	uint offset = 0;
	for (it = d.rbegin(); it != d.rend(); ++it)
	{
		uint &value = *it;
		value *= factor;
		value += offset;
		offset = value / MOD;
		value %= MOD;
	}
	while (offset)
	{
		d.push_front (offset % MOD);
		offset /= MOD;
	}
}

Deque fact[1001];

void init ()
{
	Deque d;
	d.push_front (1);
	fact[0] = fact[1] = d;
	for (uint f = 2; f <= 1000; ++f)
	{
		d *= f;
		fact[f] = d;
	}
}

int main ()
{
	uint n;
	init();
	while (cin >> n, !cin.fail())
	{
		cout << n << "!\n" << fact[n] << '\n';
	}
	return 0;
}